Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added variable vic_vm_alert_service_name for vmalert service name #67

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

HomoSapiens
Copy link
Contributor

@HomoSapiens HomoSapiens commented Jul 26, 2024

Sometimes it needs to start more than one vmalert process with different configs. E.g. running a vmalert for datasource victoriametrics and the other one for datasource loki.

Variable vic_vm_alert_service_name give you an opportunity to configure and run several vmalert services.

Example playbook:

---
- name: configure vmalert
  hosts: vmalert
  roles:
    - name: vmalert for victoriametrics
      role: victoriametrics.cluster.vmalert
      vars:
        vic_vm_alert_service_name: "vic-vmalert"
        vic_vm_alert_rules_config_path: /etc/vmalert/victoria.rules
        vic_vm_alert_rules: "{{ my_var_with_rules }}"
        vic_vm_alert_service_args:
          "rule": "{{ vic_vm_alert_rules_config_path }}"
          "datasource.url": "http://localhost:8428" 
          "notifier.url": "http://localhost:9093"
          "remoteWrite.url": "http://localhost:8428"
          "remoteRead.url": "http://localhost:8428"
          "httpListenAddr": "127.0.0.1:8880"

    - name: vmalert for loki
      role: victoriametrics.cluster.vmalert
      vars:
        vic_vm_alert_service_name: "vic-vmalert-loki"
        vic_vm_alert_rules_config_path: /etc/vmalert/loki.rules
        vic_vm_alert_rules: "{{ my_var_with_rules_loki }}"
        vic_vm_alert_service_args:
          "rule": "{{ vic_vm_alert_rules_config_path }}"
          "datasource.url": "http://localhost:3100/loki" 
          "notifier.url": "http://localhost:9093"

Also this PR fixing the dry-run mode error, when service is not exists in systemd (first dry-run on fresh server).

@HomoSapiens HomoSapiens requested a review from zekker6 as a code owner July 26, 2024 13:16
Copy link
Collaborator

@zekker6 zekker6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @HomoSapiens Thank you for the PR!

@zekker6 zekker6 merged commit 69912be into VictoriaMetrics:master Jul 26, 2024
2 checks passed
@zekker6
Copy link
Collaborator

zekker6 commented Jul 26, 2024

This PR have been included in v0.60.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants